import request from '@/utils/request'
import { commonBaseUrl } from '@/utils'

const moduleName = commonBaseUrl('B')
const bpmJn = process.env.VUE_APP_JUNNAN_NEXT_API

// 验收新流程查询人列表
export function getNextUsersByRoleAcceptance(data) {
    return request({
        url: `acceptance/api/accept/getPersonBySceneCode`,
        method: 'post',
        data: data,
        showLoading: true
    })
}
// 获取下一步节点
export function getNextActivities(query) {
    return request({
        url: `${moduleName}api/flow/getNextStep`,
        method: 'post',
        data: query,
        showMessageBox: false
    })
}

// 查询下一步办理人员列表
export function getNextUsersByRole(query) {
    return request({
        url: `${bpmJn}api/workflow/getNextUsersByRole`,
        method: 'post',
        data: query,
        showMessageBox: false,
        showLoading: true
    })
}

// 查询可回退环节节点及人员
export function getBackActivities(query) {
    return request({
        url: `${moduleName}api/flow/getBackNextStepPerson`,
        method: 'post',
        data: query,
        showMessageBox: false
    })
}

// 查询当前环节节点及人员 (转派)
export function queryCurrentNodeUser(processInstId) {
    return request({
        url: `${moduleName}api/flow/queryCurrentNodeUser?processInstId=${processInstId}`,
        method: 'get',
        showMessageBox: false
    })
}

// 获取常用意见
export function getCommonOpinion() {
return request({
    url: `${bpmJn}api/commonOpinion/getCommonOpinion`,
    method: 'get',
    showMessageBox: false
})
}

// 删除常用意见
export function deleteCommonOpinion(id) {
return request({
    url: `${bpmJn}api/commonOpinion/deleteCommonOpinion?id=${id}`,
    method: 'get',
    showMessageBox: false
})
}

// 新增常用意见
export function insertCommonOpinion(opinion) {
return request({
    url: `${bpmJn}api/commonOpinion/insertCommonOpinion?opinion=${opinion}`,
    method: 'get',
    showMessageBox: false
})
}

// 通信类: 结决算获取下一步节点
export function txGetNextStep(query) {
    return request({
        url: `${moduleName}api/settle_flow/getNextStep`,
        method: 'post',
        data: query,
        showMessageBox: false
    })
}

